﻿#ifndef MAINDIALOG_H
#define MAINDIALOG_H

#include <QDialog>
#include <QCursor>
#include <windows.h>
#include <QSystemTrayIcon>
#include <QListWidget>
#include "cscreenprotectormag.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainDialog; }
QT_END_NAMESPACE


class MainDialog : public QDialog
{
    Q_OBJECT

public:
    MainDialog(QWidget *parent = nullptr);
    ~MainDialog();

private slots:
      void on_btnOK_clicked();
      void on_btnCancel_clicked();
      void on_btnApply_clicked();
      void triggerSystemTrayExit(bool checked);
      void triggerSystemTraySetting(bool checked);
      void onActivated(QSystemTrayIcon::ActivationReason action);

      void on_btnPreview_clicked();

private:
    Ui::MainDialog *ui;
    QSystemTrayIcon* m_tray;
    QListWidget* m_pStackListWidget;
    CScreenProtectorMag* m_pScreenProtector;
    bool m_bShowTrayMsgOnce;

private:
    void ChangeConfig();
    void Data2UI();
    void InitSystemTray();

protected:
    void closeEvent(QCloseEvent *e);

};
#endif // MAINDIALOG_H
